package kas.group.pkg3;

import java.util.*;

/**
 * @author Símin Stovugarð
 * @version 2012
 */
public class Conference
{
    private String name;
    private String location;
    private String date;
    private ArrayList<People> peoples;
    private ArrayList<Instructor> instructors;
    private int capacity;

    /**
     * Create a conference with a maximum number of people attending. All other details
     * are set to default values.
     */
    public Conference()
    {
        name = "No Name";
        location = "unknown";
        date = "unknown";
        peoples = new ArrayList<People>();
        instructors = new ArrayList<Instructor>();
        capacity = 0;
        
    }

    
    
            @Override
    public String toString()
    {
        
        return name;
    }
            



            
            
    /**
     * Add people to the conference.
     */
    public void addPeople(People newPeople)
    {
        if(peoples.size() == capacity) {
            System.out.println("The conference is full, you cannot add more people.");
        }
        else {
            peoples.add(newPeople);
        }
    }

    public void addName(String n)
    {
        name = n;
    }

    public String getName()
    {
        return name;
    }

    public void setMaxNumberOfPeople(int n)
    {
        capacity = n;
    }

    public int getMaxNumberOfPeople()
    {
        return capacity;
    }

    /**
     * Add instructors to the conference.
     */
   // public void addInstructor(Instructor newInstructor)
    //{
    //    instructors.add(newInstructor);
    //}

    /**
     * Return the number of people currently in this conference.
     */
    public int numberOfPeople()
    {
        return peoples.size();
    }

    /**
     * Return the number of instructors currently in this conference.
     */
    public int numberOfInstructors()
    {
        return instructors.size();
    }

    /**
     * Set the location for this conference.
     */
    public void setPlace(String conferenceLocation)
    {
        location = conferenceLocation;
    }

    /**
     * return location for this conference
     */
    public void printLocation()
    {
        System.out.println("Conference Location: " + location);
    }

    /**
     * Set the date for this conference. The parameter should define the date
     *  such as "10 July".
     */
    public void setDate(String dateString)
    {
        date = dateString;
    }

    /**
     * return the date for this conference.
     */
    public void printDate()
    {
        System.out.println("Date of Conference: " + date);
    }

    /**
     * Print out a list of people in a conference.
     */
    public void printList()
    {
        System.out.println("Conference: " + getName());
        System.out.println("Date: " + date);
        System.out.println("Conference Location: " + location);
        System.out.println("");
        System.out.println("Instructor list:");
        System.out.println("");
        for(Instructor instructor : instructors) {
            instructor.print();
        }
        System.out.println("");
        System.out.println("Conference list:");
        System.out.println("");
        for(People people : peoples) { 
            people.print();
        }
        System.out.println("");
        System.out.println("Number of Instructors: " + numberOfInstructors());
        System.out.println("Number of People: " + numberOfPeople());
        System.out.println("Capacity: " + capacity);
    }
    
    
  
}